package com.mvc.demo;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("test1")
public class TestController1 {

    public TestController1() {
        System.out.println("TestController->instance");
    }

    @RequestMapping("/index")
    public String index() {
        System.out.println("+++++");
        return "redirect:/index.jsp";
    }

    @RequestMapping("/add")
    public ModelAndView add() {
        System.out.println("=====");
        return new ModelAndView("redirect:/index.jsp");
    }
}
